<template>
    <div class="mui-numbox" data-numbox-min="1">
      <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
      <input id="test" class="mui-input-numbox" type="number" value="1" @change="numgb" ref="numbox">
      <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    numgb(){
      // console.log(this.$refs.numbox.value)
      this.$emit('mynum',parseInt(this.$refs.numbox.value))
    
    }
  },
  mounted() {
     mui('.mui-numbox').numbox()
       console.log(this.max)
  },
  watch:{
    'max':(newValue,oldValue)=>{
      mui('.mui-numbox').numbox().setOption('max',newValue)   //手动设置最大值
    }
  },
  props:['max']
};
</script>

<style scoped>
</style>
